USE DB_TCC
IF EXISTS(SELECT 1 FROM SYSOBJECTS WHERE NAME LIKE 'P_REDE_SOCIAL_LISTAR')
	DROP PROCEDURE P_REDE_SOCIAL_LISTAR
GO
CREATE PROCEDURE P_REDE_SOCIAL_LISTAR(
	@IDREDESOCIAL VARCHAR(50))
AS BEGIN
	SELECT
		IDREDESOCIAL,
		DESCREDESOCIAL,
		ATIVO,
		USUARIOINCLUSAO,
		DTHRINCLUSAO,
		USUARIOALTERACAO,
		DTHRALTERACAO
	FROM
		REDE_SOCIAL
	WHERE
		(IDREDESOCIAL = @IDREDESOCIAL OR @IDREDESOCIAL = 0)
END